import request from '@/utils/request'

var basePath = '/alarmSet/airAlarm/'

export function listAirAlarm(query) {
  return request({
    url: basePath + 'list',
    method: 'get',
    params: query
  })
}

export function createAirAlarm(data) {
  return request({
    url: basePath + 'create',
    method: 'post',
    data
  })
}

export function readAirAlarm(data) {
  return request({
    url: basePath + 'read/' + data.id,
    method: 'get'
  })
}

export function updateAirAlarm(data) {
  return request({
    url: basePath + 'update',
    method: 'post',
    data
  })
}

export function deleteAirAlarm(data) {
  return request({
    url: basePath + 'delete/' + data.fwarringno,
    method: 'delete'
  })
}

export function listUserByFsiteNo(query) {
  return request({
    url: basePath + 'listUserByFsiteNo/' + query,
    method: 'get'
  })
}

export function listPointByFsiteNo(query) {
  return request({
    url: basePath + 'listPointByFsiteNo/' + query,
    method: 'get'
  })
}

export function listPointByFpointNo(query) {
  return request({
    url: basePath + 'listPointByFpointNo/' + query,
    method: 'get'
  })
}

export function listPointByFsiteNo2(query) {
  return request({
    url: basePath + 'listPointByFsiteNo2/' + query,
    method: 'get'
  })
}

export function getPermissions(id, fsiteNoBelong) {
  return request({
    url: basePath + 'permissions?userId=' + id + '&fsiteNo=' + fsiteNoBelong,
    method: 'get'
  })
}

export function getPermissionsBox(id, fsiteNoBelong) {
  return request({
    url: basePath + 'boxPermissions?userId=' + id + '&fsiteNo=' + fsiteNoBelong,
    method: 'get'
  })
}

export function updatePermission(data) {
  return request({
    url: basePath + 'assign',
    method: 'post',
    data
  })
}

export function updatePermissionBox(data) {
  return request({
    url: basePath + 'assignBoxPerms',
    method: 'post',
    data
  })
}

export function sTsAiritemOptions() {
  return request({
    url: basePath + 'sTsAiritemOptions',
    method: 'get'
  })
}
